<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
 /*   (function (){

        var name='the window';
        var obj={
            name:'my object',
            getFun:function (){

                console.log(this.name)
            }

        }

        obj.getFun();


    })()*/





        var name='the window';
        var obj={
            name:'my object',
            getFun:function (){

                console.log(this)           //obj
                var that=this;


                var fn= function (){

                  console.log(this.name)   //the window
              }

              return fn;
            }

        }

        obj.getFun()();





</script>
</body>
</html>